﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Shared/ContentMaster.master"
    CodeFile="voteList.aspx.cs" Inherits="ltMan_votes_voteList" %>

<asp:Content ID="C1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="C2" ContentPlaceHolderID="CPH1" runat="Server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script>
            var win1;
            function goAdd() {
                openCWin('添加投票');
            }
            function goEdit(row) {
                var id = row.getDataKeyValue("id");
                openCWin('修改投票', id);
            }
            function openCWin(title, parm) {
                win1 = radopen('voteAdd.aspx?id=' + parm);
                win1.setSize(510, 470);
                win1.Center();
                win1.set_title(title);
            }
            function reloadData() {
                if (win1)
                    win1.close();
                $find('<%=RadGrid1.ClientID %>').get_masterTableView().rebind();
            }
            Sys.Application.add_load(function () {
                $('.grid-inline-edit').click(function () {
                    openCWin('修改投票', $(this).attr('eid'));
                });
            });
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManagerProxy runat="server" ID="proxy1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="b1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <div class="searchArea">
        主题：<telerik:RadTextBox EmptyMessage="搜索主题" ID="sName" runat="server" MaxLength="50" />
        <telerik:RadButton Icon-PrimaryIconCssClass="icon-search" runat="server" ID="b1"
            OnClick="b1_Click" Text="搜索" />
    </div>
    <telerik:RadGrid ID="RadGrid1" runat="server" Width="100%" OnDeleteCommand="RadGrid1_DeleteCommand">
        <ClientSettings>
            <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="340" />
        </ClientSettings>
        <MasterTableView CommandItemDisplay="Top" EditMode="PopUp" DataKeyNames="id">
            <CommandItemTemplate>
                <telerikEx:GridCommandEx ID="GridCommandEx1" runat="server" OnAddClicking="goAdd"
                    OnEditClicking="goEdit" />
            </CommandItemTemplate>
            <PagerTemplate>
                <telerikEx:RadPagerEx ID="RadPagerEx1" runat="server" />
            </PagerTemplate>
            <Columns>
                <telerik:GridClientSelectColumn HeaderStyle-Width="28" ItemStyle-Width="28" />
                <telerik:GridBoundColumn DataField="id" Visible="false" />
                <telerik:GridBoundColumn HeaderText="主题" DataField="title" DataFormatString="<nobr>{0}</nobr>" />
                <telerik:GridBoundColumn HeaderStyle-Width="80" HeaderStyle-HorizontalAlign="Center"
                    HeaderText="开始时间" DataField="time" DataFormatString="{0:yyyy-MM-dd}" />
                <telerik:GridBoundColumn HeaderStyle-Width="80" HeaderStyle-HorizontalAlign="Center"
                    HeaderText="结束时间" DataField="overtime" DataFormatString="{0:yyyy-MM-dd}" />
                <telerik:GridTemplateColumn HeaderStyle-Width="50" HeaderStyle-HorizontalAlign="Center"
                    ItemStyle-HorizontalAlign="Center" HeaderText="操作">
                    <ItemTemplate>
                        <telerikEx:GridInlineCommandEx ID="GridInlineCommandEx1" runat="server" UseExternalEdit="true" EditParameter='<%# Eval("id") %>' />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
</asp:Content>
